#ifndef _MP3_PARSER_H
#define _MP3_PARSER_H

#include "mpg123.h"
#include <unistd.h>
#include <stdio.h>
#include <QString>
#include <QObject>
#include "SoundSample.h"

#define MPG123_ENC_8 15
#define MPG123_ENC_16 64
#define MPG123_ENC_24 16384

using namespace std;
class MP3Parser : public QObject
{
	Q_OBJECT
	
public:
	// returns the pointer to the data array, otherwise NULL
	unsigned char* parse( SoundSample* parentSample, size_t & buffer_return_size);
	// gets the ID3 tags and sets the info to passed sample instance
	int gatherID3Info( SoundSample* parentSample);

private:
	void separateLines(string & buffer, mpg123_string* inlines);
	
signals:
	void percentFinishedParsing(int);
};

#endif